if SERVER then
	registerCommand("givehealth", "Gives the amount of health you specify to the player you designate - defaults to yourself if you leave out the player - player comes before value", function(param)
		local healthGive = "caller gave target amount health"
		local healthKill = "caller took too much health from target"
		if param["settings"]["givehealth_msg"] then
			healthGive = param["settings"]["givehealth_msg"]
		end
		if param["settings"]["givehealth_kill_msg"] then
			healthKill = param["settings"]["givehealth_kill_msg"]
		end
		local healthTable = {}
		healthTable["caller"] = getCaller(param[1])
		if param[3] != nil && param[3] != "" then
			local targs = string.Explode(" ", param[3])
			local amount = tonumber(table.remove(targs, table.Count(targs)))
			if not amount then
				return nil
			end
			if table.Count(targs) >= 1 then
				for i, targ in pairs(targs) do
					local plyTarg = getPlayerByName(targ)
					if plyTarg then
						healthTable["target"] = plyTarg:GetName()
						local plyamount = amount
						if plyTarg:Health() + plyamount > 99999 then
							plyamount = 99999 - plyTarg:Health()
						end
						if plyTarg:Health() + plyamount <= 0 then
							plyTarg:Kill()
							display(param[1], "givehealth", { plyTarg } , parseDisplayMessage(healthKill, healthTable))
							return nil
						end
						healthTable["amount"] = plyamount
						
						display(param[1], "givehealth", { plyTarg } , parseDisplayMessage(healthGive, healthTable))
						plyTarg:SetHealth(plyTarg:Health() + plyamount)
					end
				end
			else
				if not param[1]:IsValid() then
					return nil
				end
				healthTable["target"] = param[1]:GetName()
				if param[1]:Health() + amount > 99999 then
					amount = 99999 - param[1]:Health()
				end
				if param[1]:Health() + amount <= 0 then
					param[1]:Kill()
					display(param[1], "givehealth", { nil } , parseDisplayMessage(healthKill, healthTable))
					return nil
				end
				healthTable["amount"] = amount
				
				display(param[1], "givehealth", { nil } , parseDisplayMessage(healthGive, healthTable))
				param[1]:SetHealth(param[1]:Health() + amount)
			end
		end
	end)
end